import os

# 设置环境变量

os.environ['http_proxy'] = 'http://hewei:wico2023@ddns.sunnyho.eu.org:7893'
os.environ['https_proxy'] = 'http://hewei:wico2023@ddns.sunnyho.eu.org:7893'

from ultralytics.models.fastsam import FastSAMPredictor

# Create FastSAMPredictor
overrides = dict(conf=0.25, task="segment", mode="predict", model="FastSAM-s.pt", save=False, imgsz=1024)
predictor = FastSAMPredictor(overrides=overrides)

# Segment everything
everything_results = predictor("1.jpg")

# Prompt inference

text_results = predictor.prompt(everything_results, texts="hole")
